package com.service.impl;

import com.bean.Films;
import com.dao.FilmsMapper;
import com.service.FilmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Component
@Service
public class FilmsServiceImpl implements FilmsService {
    @Autowired
    private FilmsMapper filmsMapper;

    @Override
    public int save(Films films) {
        return filmsMapper.insert(films);
    }

    @Override
    public int remove(Films films) {
        return filmsMapper.delete(films);
    }

    @Override
    public int modify(Films films) {
        return filmsMapper.update(films);
    }

    @Override
    public List<Films> find(Films films) {
        return filmsMapper.select(films);
    }

    @Override
    public int count(Map<String, Object> map) {
        return filmsMapper.selectCount(map);
    }

    @Override
    public List<Films> query(Map<String, Object> map) {
        return filmsMapper.selectByPage(map);
    }
}
